<?php

session_start();

include_once("connexion.php");

if ($_SESSION['log'] == 1) {
	$query =mysqli_fetch_array(mysqli_query($bdd,"SELECT * FROM utilisateurs WHERE id=".$_SESSION['id_user']));
}
if (isset($_POST["OK"])){
	$pseudo = $_POST["pseudo"];
	$nom = $_POST["nom"];
	$prenom = $_POST["prenom"];
	$adresse = $_POST["adresse"];	
	$codepostal = $_POST["codepostal"];
	$mail = $_POST["mail"];
	$password = $_POST["password"];
	$query = "UPDATE utilisateurs SET 
		pseudo = '".$pseudo."',
		nom = '".$nom."',
		prenom = '".$prenom."',
		adresse = '".$adresse."',
		codepostal = '".$codepostal."',
		mail = '".$mail."',
		password = '".$password."'
		WHERE id = ".$_SESSION['id_user'];
		;
	$resultat = mysqli_query($bdd,$query);
	header('Location:detail_profil.php');
}

$erreur = "";

include_once("modification_profil.html");
?>